package com.qingding.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.Toast;

import com.avos.avoscloud.AVUser;
import com.qingding.R;
import com.qingding.fragment.WoDeFragment;

public class SettingActivity extends AppCompatActivity {
    private ImageButton about;
    private ImageButton feedback;
    private Button exit;
    private ImageButton back;
    private Intent intent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);

        about = (ImageButton)findViewById(R.id.about);
        feedback = (ImageButton)findViewById(R.id.feedback);
        exit = (Button)findViewById(R.id.exit);
        back = (ImageButton) findViewById(R.id.backsetting);
        exit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AVUser.logOut();// 清除缓存用户对象
                AVUser currentUser = AVUser.getCurrentUser();// 现在的 currentUser 是 null 了
                Toast.makeText(SettingActivity.this,"退出成功", Toast.LENGTH_SHORT);
                intent = new Intent(SettingActivity.this,LoginActivity.class);
                startActivity(intent);
            }
        });
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent = new Intent(SettingActivity.this,MainActivity.class);
                startActivity(intent);
            }
        });
    }
       public void feedback(View view){
        Intent intent = new Intent(SettingActivity.this,FeedBackActivity.class);
        startActivity(intent);
    }
       public void about(View view){
        Intent intent = new Intent(SettingActivity.this,AboutUsActivity.class);
        startActivity(intent);
    }
}
